package com.cecsmsserve.controller;


import com.cecsmsserve.entity.Report;
import com.cecsmsserve.service.IReportService;
import com.cecsmsserve.util.result.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王郝浠
 * @since 2024-05-20
 */
@CrossOrigin
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    IReportService reportService;

    @GetMapping("/selectByuId/{uId}")
    public CommonResult selectByuId(@PathVariable int uId){
        return reportService.selectByuId(uId);
    }

    @PutMapping("/insert")
    public CommonResult insert(@RequestBody Report report){
        return reportService.insert(report);
    }

    @PostMapping("/update")
    public CommonResult update(@RequestBody Report report){
        return reportService.update(report);
    }
}
